(function(exports){ 
    
    function UjsScriptGetter(){}
    
    /**
     * 获取移动端核心脚本路径。
     * @return Array.
     */
    UjsScriptGetter.prototype.getMobileScript = function(){
        return [
            //基于jQuery
            'jquery/jquery-1.8.3.js',
            
            'webBaseScript/jquery.base.js',
            'webBaseScript/jquery.cookie.js',
                                                                      
            //JavaScript 核心扩展.
            'jsExt/Object.js',
            'jsExt/String.js',
            'jsExt/Array.js',
            'jsExt/Date.js',
            'jsExt/Math.js',
            'jsExt/JSON.js',
            'jsExt/Number.js',
            'jsExt/Function.js',
            
            'jsExt/RegExp.js',            
            'jsExt/Type.js',
            'jsExt/Size.js',  
            
            //Custom Event
            'jsExt/event/Observable.js',
            'jsExt/event/EventManager.js', 
                        
            //Data Interaction.
            'jsExt/data/encoding/Base64.js',
            
            //基础UI扩展.
            'jsExt/tmpl.js',
            
            //浏览器对象模型扩展.
            'webExt/browser/location.js',
            'webExt/browser/geo.js',
            'webExt/browser/Event.js',
            'webExt/ui/paneMask.js',            
            'webExt/browser/page.js'
        ];
    };
    
    /**
     * 获取移动端核心脚本路径(不包含jQuery库)。
     * @return Array.
     */
    UjsScriptGetter.prototype.getMobileScript_NoJQuery = function(){
        return [                                                                      
            //JavaScript 核心扩展.
            'jsExt/Object.js',
            'jsExt/String.js',
            'jsExt/Array.js',
            'jsExt/Date.js',
            'jsExt/Math.js',
            'jsExt/JSON.js',
            'jsExt/Number.js',
            'jsExt/Function.js',
            
            'jsExt/RegExp.js',            
            'jsExt/Type.js',
            'jsExt/Size.js',  
                        
            //Custom Event
            'jsExt/event/Observable.js',
            'jsExt/event/EventManager.js', 
            
            //Data Interaction.
            'jsExt/data/encoding/Base64.js',
            
            //基础UI扩展.
            'jsExt/tmpl.js',
            
            //浏览器对象模型扩展.
            'webExt/browser/location.js',
            'webExt/browser/geo.js',
            'webExt/browser/Event.js'
        ];
    };
    
    /**
     * 获取核心脚本路径。
     * @return Array.
     */
    UjsScriptGetter.prototype.getCoreScript = function(){
        return [            
            //基于jQuery
            'jquery/jquery-1.8.3.js',
            
            'webBaseScript/jquery.base.js',
            'webBaseScript/jquery.cookie.js',
            'webBaseScript/prefixfree.js',
                                                                      
            //JavaScript 核心扩展.
            'jsExt/Object.js',
            
            //新版本中去掉.
            'compatibility.js',
            
            'jsExt/String.js',
            
            'jsExt/Array.js',
            'jsExt/Date.js',
            'jsExt/Math.js',
            'jsExt/JSON.js',
            'jsExt/Number.js',
            'jsExt/Function.js',            
            'jsExt/RegExp.js',            
            'jsExt/Type.js',
            'jsExt/Size.js',              
            //Custom Event
            'jsExt/event/Observable.js',
            'jsExt/event/EventManager.js',                         
            //Data Interaction.
            'jsExt/data/encoding/Base64.js',                
            'jsExt/data/DataAdapter.js',                        
            'jsExt/data/Store.js',     
            //基础UI扩展.
            'jsExt/tmpl.js',            
            'jsExt/Timer.js', 
            

            
            'webExt/browser/Event.js',                      
            //文件操作扩展.
            'webExt/browser/File.js',            
            //浏览器对象模型扩展.
            'webExt/browser/location.js',
            'webExt/browser/geo.js',
            'webExt/browser/plugin.js',            
            //Util Method            
            'webExt/browser/Image.js',
            'webExt/browser/form.js',
            'webExt/util/ErrorsMap.js',
            'webExt/util/BizBase.js',            
            'webExt/util/session.js',            
            //Expression parser
            'webExt/exp/perm.js',
            'webExt/exp/bindExp.js',
            'webExt/exp/lan.js',  
            'webExt/browser/masterpage.js',                        
            'webExt/browser/dd.js',            
            'webExt/ui/bubble.js',  
            'webExt/ui/paneMask.js',
            'webExt/ui/apprise.js',            
            'webExt/browser/fullscreen.js', 
            'webExt/browser/titleScroller.js',
            'webExt/browser/WebNotification.js',            
            'webExt/browser/page.js',            
            'webExt/browser/UploadHelper.js',                        
            //Common Component. 
            'webExt/ui/Component.js',
            'webExt/ui/Dialog.js',   
            'webExt/ui/Highlighter.js',
            'webExt/ui/HeavyButton.js',
            'webExt/ui/DragSelection.js',            
            'webExt/util/debug.js'
        ];
    };
    
    UjsScriptGetter.prototype.getCmpScript = function(){
        return [
            //数据存储，格式转换.            
            'subjects/upload/Resumable.js',                         
            //绘制工具.            
            'subjects/draw/DrawPallet.js',
                        
            //通用对话框.
            'subjects/dialog/StringListEditorDialog.js',
            'subjects/dialog/MediaSliderDialog.js',
            'subjects/dialog/ImagePreviewDialog.js',
            'subjects/dialog/VideoPreviewDialog.js',
            
            'subjects/map/GoogleMapAPI.js'
        ];
    };
    
    UjsScriptGetter.prototype.getJQueryPluginsScript = function(){
        return [
            //菜单导航，工具条。       
            'jqueryPlugins/nav/jquery.toolbar.js',
            'jqueryPlugins/nav/jquery.contextMenu.js',  
            'jqueryPlugins/nav/jquery.ddActionMenu.js',
            'jqueryPlugins/nav/jquery.hotkeys.js',
            
            //动画支持.                        
            'jqueryPlugins/animation/jquery.easing.js',
            'jqueryPlugins/animation/jquery.transit.js',                       
            
            //表单元素.
            'jqueryPlugins/form/jquery.passwordStrength.js',
            'jqueryPlugins/form/jquery.selectBox.js',            
            'jqueryPlugins/form/jquery.progressBar.js',
            'jqueryPlugins/form/jquery.stringList.js',
            'jqueryPlugins/form/jquery.singleImgUploader.js',                           
            'jqueryPlugins/form/jquery.searchable.js',
            'jqueryPlugins/form/jquery.editInplace.js',   
            'jqueryPlugins/form/jquery.iPhoneSwitch.js',
            'jqueryPlugins/form/jquery.autoCompleteBox.js',
                        
            //数据存储.            
                                    
            //其它插件.                        
            'jqueryPlugins/misc/jquery.scrollEnd.js',                                          
            'jqueryPlugins/misc/jquery.animateTitle.js',
            'jqueryPlugins/misc/jquery.floatCard.js',            
            'jqueryPlugins/misc/jquery.tooltip.js',
            'jqueryPlugins/misc/jquery.cursor.js',
            'jqueryPlugins/misc/jquery.scroll.js',            
            'jqueryPlugins/misc/jquery.style.js',
            'jqueryPlugins/misc/jquery.manipulation.js',
            'jqueryPlugins/misc/jquery.mouse.js',
                        
            //托拽支持.
            'jqueryPlugins/dd/jquery.movable.js',
            'jqueryPlugins/dd/jquery.resizable.js',                            
            
            //布局对象.                              
            'jqueryPlugins/layout/jquery.accordion.js',
            'jqueryPlugins/layout/jquery.tabControl.js',
            'jqueryPlugins/layout/jquery.grouper.js',
            'jqueryPlugins/layout/jquery.listView.js',
            'jqueryPlugins/layout/jquery.cardLayout.js',   
            
            //小工具插件.
            'jqueryPlugins/tools/jquery.jsonViewer.js',
            'jqueryPlugins/tools/jquery.wysiwyg.js',
            
            //jQuery jsTree plugins.
            'jqueryPlugins/jsTree/jquery.jstree.js',       
            'jqueryPlugins/jsTree/jquery.jstree.ui.js',
            'jqueryPlugins/jsTree/jquery.jstree.crrm.js',
            'jqueryPlugins/jsTree/jquery.jstree.theme.js',        
            'jqueryPlugins/jsTree/jquery.jstree.hotkeys.js',
            'jqueryPlugins/jsTree/jquery.jstree.json.js',                        
            'jqueryPlugins/jsTree/jquery.jstree.cookies.js',
            'jqueryPlugins/jsTree/jquery.jstree.sort.js',            
            'jqueryPlugins/jsTree/jquery.jstree.dnd.js',
            'jqueryPlugins/jsTree/jquery.jstree.checkbox.js',                        
            'jqueryPlugins/jsTree/jquery.jstree.search.js',
            'jqueryPlugins/jsTree/jquery.jstree.contextmenu.js',            
            'jqueryPlugins/jsTree/jquery.jstree.types.js',
            'jqueryPlugins/jsTree/jquery.jstree.html.js',
            'jqueryPlugins/jsTree/jquery.jstree.themeroller.js',
            'jqueryPlugins/jsTree/jquery.jstree.unique.js',
            'jqueryPlugins/jsTree/jquery.jstree.wholerow.js',
            'jqueryPlugins/jsTree/jquery.jstree.model.js',
            'jqueryPlugins/jsTree/jquery.treeNodeSelector.js',    
                        
            //jQuery table plugins.
            'jqueryPlugins/table/jquery.paginate.js',       
            'jqueryPlugins/table/jquery.tableContextMenu.js',
            'jqueryPlugins/table/jquery.table.js'
        ];
    };
    
    //---------------------------------------------------------------------------
    
    UjsScriptGetter.prototype.getScript = function(resConfig){
        var scripts = [];
        if(resConfig['core'] !== false){            
            scripts = scripts.concat(this.getCoreScript());
        }   
        if(resConfig['mobile'] === true){
            scripts = scripts.concat(this.getMobileScript()); 
        }  
        if(resConfig['mobile_noJQuery'] === true){
            scripts = scripts.concat(this.getMobileScript_NoJQuery()); 
        }  
        if(resConfig['component'] === true){
            scripts = scripts.concat(this.getCmpScript()); 
        }        
        if(resConfig['jqueryPlugins'] === true){
            scripts = scripts.concat(this.getJQueryPluginsScript()); 
        }
        return scripts;
    };
    
    //---------------------------------------------------------------------------
       
    exports.getResPath = function(resConfig){        
        var scriptGetter = new UjsScriptGetter();        
        return scriptGetter.getScript(resConfig || {});
    };
})(typeof exports !== "undefined" ? exports : this.ujs);